#ifndef VDMA_H
#define VDMA_H



typedef struct{
    unsigned int *fbV;
    unsigned int fbP;
} fb_addr;

typedef struct{
    unsigned int baseAddr;
    int vdmaHandler;
    int width;
    int height;
    int pixelLength;
    int fbLength;
    unsigned int* vdmaVirtualAddress;

    pthread_mutex_t lock;
} vdma_handle;


void vdma_set(vdma_handle *handle, int num, unsigned int val);

int vdma_setup(	vdma_handle *handle, unsigned int baseAddr, int width, int height, int pixelLength, fb_addr *fbaddr);

void vdma_halt(vdma_handle *handle, fb_addr *fbaddr);

void vdma_status_dump(int status);

void vdma_s2mm_status_dump(vdma_handle *handle);

void vdma_mm2s_status_dump(vdma_handle *handle);

void vdma_start_buffering_set(vdma_handle *handle, int MM2S_SS2M) ;

void vdma_start_buffering(vdma_handle *handle, fb_addr *fbaddr, int frame_id, int MM2S_SS2M);

int vdma_running(vdma_handle *handle, int MM2S_SS2M);

int vdma_idle(vdma_handle *handle, int MM2S_SS2M);











#endif // VDMA_H

